package controller;

import java.util.Observable;
import java.util.Observer;

import javax.swing.JTextField;

import model.CModel;

//This is a ConcreteObserver that Implements the Observer interface
public class InputFelt extends JTextField implements Observer {

	private CModel model;

	public InputFelt(CModel model) {

		setHorizontalAlignment(RIGHT);

		this.model = model;

		model.addObserver(this); // register with the ConcreteSubject, to be able to receive updates
	}

	@Override
	public void update(Observable obs, Object args) {

		setText("" + ((CModel) obs).inputIFeltet());
	}

}